@model List<WebBookmarkApp.Models.Note>
@{ ViewData["Title"] = "笔记"; }

<div class="container mt-4">
    <div class="d-flex justify-content-between align-items-center mb-4"><a asp-action="Create" class="btn btn-primary">添加笔记</a></div>
    @if (Model != null && Model.Any())
    {
        @foreach (var note in Model)
        {
            <div class="note-item mb-4 d-flex justify-content-between align-items-center">
                <div>
                    <h2>@note.Title</h2>
                    <p class="lead text-center">@note.Content</p>
                </div>
                <a asp-action="Delete" asp-route-id="@note.Id" class="btn btn-danger">删除</a>
            </div>
        }
    }
    else
    {
        <div class="alert alert-info">当前无笔记</div>
    }
</div>